import { EChartOption } from 'echarts';
const COLOR = '#666';

type PieDataType = number[] | number[][] | EChartOption.SeriesPie.DataObject[];

export const getActiveOption = () => ({
  color: ['rgb(23,144,255)', '#12c2c2', '#2fc25b', '#f04864', '#8542e0'],
  title: {
    zlevel: 0,
    text: '',
    top: 'center',
    left: '50%',
    textAlign: 'center',
    textStyle: {
      rich: {
        value: {
          color: COLOR,
          fontSize: 20,
          fontWeight: 'bold',
          lineHeight: 20,
        },
        name: {
          color: '#909399',
          lineHeight: 20,
        },
      },
    },
  },
  tooltip: {
    // 悬停指示
    trigger: 'item',
    formatter: '{b}: {c} ({d}%)',
  },
  series: [
    {
      zlevel: 1,
      type: 'pie',
      clockwise: false, //饼图的扇区是否是顺时针排布
      minAngle: 2, //最小的扇区角度（0 ~ 360）
      radius: ['55%', '70%'],
      center: ['50%', '50%'],
      itemStyle: {},
      label: {
        normal: {
          show: true,
          formatter: '{b}: {c}({d}%)', //自定义显示格式(b:name, c:value, d:百分比)
        },
      },
      data: [] as PieDataType,
    },
  ] as EChartOption.SeriesPie[],
});
